SET CGO_ENABLED=0
SET GOOS=linux
SET GOARCH=amd64

rmdir /s/q linux\\cloud
mkdir linux 
mkdir linux\\cloud
mkdir linux\\iotbase
cd TM/cloud/gosrc

go mod tidy
go build -tags cloud -o ../../../linux/cloud/bin/tm

cd ../../../DM/cloud/gosrc

go mod tidy
go build -tags cloud -o ../../../linux/cloud/bin/dm
chdir

cd ../../../

cd DEVS/onvif/gosrc
go mod tidy
go build -tags cloud -o ../../../linux/cloud/bin/onvif
cd ../../../

cd DEVS/mm/gosrc
go mod tidy
go build -tags cloud -o ../../../linux/cloud/bin/mm
cd ../../../

cd Business/authedge/gosrc
go mod tidy
go build -tags "cloud gate" -o ../../../linux/cloud/bin/business
cd ../../../

cd DEVS/magical/gosrc
go mod tidy
go build -tags cloud -o ../../../linux/cloud/bin/magical
cd ../../../



cd TM/cfgpage
call yarn build-cloud --dest ../../linux/cloud/bin/dist
cd ../../../


xcopy defaultdb linux/cloud/ /s/y 

timeout /T 5 /NOBREAK